import java.awt.event.KeyEvent;

import org.powerbot.core.script.job.Task;
import org.powerbot.core.script.job.state.Node;
import org.powerbot.game.api.methods.Game;
import org.powerbot.game.api.methods.Walking;
import org.powerbot.game.api.methods.Widgets;
import org.powerbot.game.api.methods.input.Keyboard;
import org.powerbot.game.api.methods.interactive.NPCs;
import org.powerbot.game.api.methods.interactive.Players;
import org.powerbot.game.api.methods.tab.Inventory;
import org.powerbot.game.api.methods.widget.Bank;
import org.powerbot.game.api.wrappers.interactive.NPC;


public class Banker extends Node{

	@Override
	public boolean activate() {
		// TODO Auto-generated method stub
		return Fisher.banking && !Fisher.dropping && Game.isLoggedIn();
	}

	@Override
	public void execute() {
		// TODO Auto-generated method stub
		
		if(!Bank.isOpen())
		{
			NPC n = NPCs.getNearest(496);
			Walking.walk(n.getLocation());
			Bank.open();
			System.out.println("walking to banker");
		}
		else if(Inventory.getCount()>0)
		{
			Bank.depositInventory();
			System.out.println("depositing");
		}
		if(Inventory.getCount()== 0)
		{
			Fisher.banking = false;
			System.out.println("finished");
		}
	}

}
